const http = require('http')
let counter = 0

const server = http.createServer((req, res) => {
  if (req.url === '/') {
    counter++
  }
  res.write(`I have been accessed ${counter} times.`)
  res.end()
}).listen(3000, () => {
  console.log('HTTP server running in port: http://localhost:3000')
})
